<If Loop>
   <IsFKey>
Imports System.Data.SqlClient
  <ExitLoop>
</If Loop>

<If Loop>
   <IsFKey>
Public Class <TableU>_<RTableU>Data

    Public Shared Function SelectAll() As DataTable
        Dim connection As SqlConnection = <Database>Data.GetConnection
        Dim selectProcedure As String = "[<Owner>].[<TableU>_<RTableU><MiscTag>Select]"
        Dim selectCommand As New SqlCommand(selectProcedure, connection)
        selectCommand.CommandType = CommandType.StoredProcedure
        Dim dt As New DataTable
        Try
            connection.Open()
            Dim reader As SqlDataReader = selectCommand.ExecuteReader()
            If reader.HasRows Then
                dt.Load(reader)
            End If
            reader.Close()
        Catch ex As SqlException
            Return dt
        Finally
            connection.Close()
        End Try
        Return dt
    End Function

    Public Shared Function List() As List(Of <RTableU>)
        Dim  <RTableU>List As New List(Of <RTableU>)
        Dim connection As SqlConnection = <Database>Data.GetConnection
        Dim selectProcedure As String = "[<Owner>].[<TableU>_<RTableU><MiscTag>Select]"
        Dim selectCommand As New SqlCommand(selectProcedure, connection)
        selectCommand.CommandType = CommandType.StoredProcedure
        Try
            connection.Open()
            Dim reader As SqlDataReader = selectCommand.ExecuteReader()
            Dim  <RTableU> As <RTableU>
            Do While reader.Read
                <RTableU> = New <RTableU>
                <IsFKey>
                <RTableU>.<RFieldU> = <Convert>(reader("<RField>").ToString)
                <IsFKey>
                <And>
                <IsRDisplayField>
                <RTableU>.<RDisplayFieldU> = System.Convert.ToString(reader("<RDisplayField>").ToString)
                <IsFKey>
                <RTableU>List.Add(<RTableU>)
            <IsFKey>
            Loop
            reader.Close()
        Catch ex As SqlException
            Throw ex
        Finally
            connection.Close()
        End Try
        Return <RTableU>List
    End Function

End Class

</If Loop>
